<?php
if(isset($_GET["name"])){
	$template_name=$_GET["name"].'_template.html';
}
?>
<!DOCTYPE html>
<html>

<head>
	<title>&nbsp;</title>
	<meta charset="utf-8" />
	<meta http-equiv="x-ua-compatible" content="IE=edge">
	<link rel="stylesheet" href="css/style.css" />
	<link rel="stylesheet" href="css/font-awesome.css" />
	<script src="assets/jquery-2.1.3.min.js"></script>
	<script src="assets/jsrender.min.js"></script>
    <script src="assets/component.js"></script>
</head>

<body class="or-change">

	<?php if(isset( $template_name )){ ?>
	<script>
		var template_name = "<?php echo $template_name; ?>" ;
		$.get(template_name, function (template) {
			var jsRender_template = $.templates(template);			
			$.ajax({
				url: "../json/lang_zh_CN.json",
				dataType: 'jsonp',
				jsonp: 'callback',
				jsonpCallback: 'jsonpcallback',
				success: function(lang){
					var html, data = {};
                    data.lang = lang;
                    html = jsRender_template.render(data);
					$("body").append(html);
				}
			});
		});
	</script>
	<?php } else{ ?>
	<form>
		<input name="name" placeholder="请输入模板名" />
		<input type="submit" value="查看" />
	</form>

	<?php } ?>

</body>

</html>